package com.twu.biblioteca;

import java.io.*;

public class InteractiveConsole {
    private BufferedReader reader;
    private InputStream in;
    private PrintStream out;

    public InteractiveConsole(InputStream in, PrintStream out) {
        this.reader = new BufferedReader(new InputStreamReader(in));
        this.out = out;
    }

    String readln() throws IOException {
        String line = reader.readLine();
        if (line != null) {
            return line;
        } else {
            return "";
        }
    }

    char read() throws IOException {
        return readln().charAt(0);
    }

    void println(String line) {
        out.println(line);
    }
}
